<?php
	include('tp-values.php');

	/*
	 *	Convenience function for outputing input checked attribute
	 *	based on whether expression evaluates to true.
	 */
	function tp_checked($expression) {
		if($expression) {
			print ' checked="checked"';
		} else {
			print '';
		}
	}
	
	function tp_options($options, $value, $default) {
		if(empty($value)) {
			$selected = ' selected="selected"';
		}
		$out = '<option value=""' . $selected . '>' . $default . "</option>\n";
		foreach($options as $option) {
			if($option == $value) {
				$selected = ' selected="selected"';
			} else {
				$selected = '';
			}
			$out .= '<option value="' . $option . '"' . $selected . '>' . $option . "</option>\n";
		}
		print $out;
	}
	
	if(empty($radios)) {
		$radios = array();
	}
?>

<?php
	$checked = '';
	if(!empty($offer)) {
		$checked = ' checked="checked"';
	}
?>
<div class="tp-form-group tp-checkbox-group">
	<input type="checkbox" id="tp_offer_flag" name="tp_offer_flag"<?php print $checked ?>><label for="tp_offer_flag">This post is a travel offer</label>
</div>
<div id="tp_form">
	<fieldset id="tp_offer_fieldset">
		<h2>Offer</h2>
		
		<div class="tp-form-group tp-textarea-group">
			<label for="summary_text">Offer Summary</label>
			<textarea id="summary_text" name="summary_text"><?php print $offer->summary_text ?></textarea>
		</div>
		
		<!-- offer date group -->
		<div id="tp_offer_date_section" class="tp-section">
			<?php
				if(empty($radios['offer_date_type_fixed'])) {
					$radios['offer_date_type_fixed'] = false;
					if(!empty($offer->offer_date_type_fixed)) {
						$radios['offer_date_type_fixed'] = true;
						$radios['offer_date_type_range'] = false;
					}
				}
				
				if(empty($radios['offer_date_type_range'])) {
					$radios['offer_date_type_range'] = false;
					if(!empty($offer->offer_start_date)) {
						$radios['offer_date_type_range'] = true;
						$radios['offer_date_type_fixed'] = false;
					}
				}
			?>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2" class="tp-radio-group">
						<input type="radio" id="offer_date_type_range" name="offer_date_type" value="range"<?php print tp_checked($radios['offer_date_type_range']) ?>/>
						<label for="offer_date_type_range">Offer Date Range</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="offer_start_date">Start</label>
					</td>
					<td>
						<input type="text" id="offer_start_date" name="offer_start_date" size="10" maxlength="10" value="<?php print $offer->offer_start_date ?>"/>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="offer_end_date">End</label>
					</td>
					<td>
						<input type="text" id="offer_end_date" name="offer_end_date" size="10" maxlength="10" value="<?php print $offer->offer_end_date ?>"/>
					</td>
				</tr>
			</table>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2">
						<input type="radio" id="offer_date_type_fixed" name="offer_date_type" value="fixed"<?php print tp_checked($radios['offer_date_type_fixed']) ?>/>
						<label for="offer_date_type_fixed">Fixed Offer Date</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="offer_fixed_date">Date</label>
					</td>
					<td>
						<input type="text" id="offer_fixed_date" name="offer_fixed_date" size="10" maxlength="10" value="<?php print $offer->offer_fixed_date ?>"/>
					</td>
				</tr>
			</table>
			<div class="tp-clear-both"></div>
		</div>
		
		<div id="tp_offer_location_section" class="tp-section">
			<!-- offer region -->
			<div id="tp_region_section" class="tp-section">
				<?php
					if(empty($radios['region_type_code'])) {
						$radios['region_type_code'] = false;
						if(!empty($offer->region_code)) {
							$radios['region_type_code'] = true;
							$radios['region_type_name'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2" class="tp-radio-group">
							<input type="radio" id="region_type_code" name="region_type" checked="checked"<?php print tp_checked($radios['region_type_code']) ?>/>
							<label for="region_type_code">Standard Region</label>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="tp-select-group">
							<select name="region_code">
								<?php print tp_options($regions, $offer->region_code, 'Standard Region...') ?>
							</select>
						</td>
					</tr>
				</table>
				<?php
					if(empty($radios['region_type_name'])) {
						$radios['region_type_name'] = false;
						if(!empty($offer->region_type_name)) {
							$radios['region_type_name'] = true;
							$radios['region_type_code'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2" class="tp-radio-group">
							<input type="radio" id="region_type_name" name="region_type"<?php print tp_checked($radios['region_type_name']) ?>/>
							<label for="region_type_name">Other Region</label>
						</td>
					</tr>
					<tr class="tp-inputtext-group">
						<td>
							<label for="region_name">Name</label>
						</td>
						<td>
							<input type="text" id="region_name" name="region_name" size="24" maxlength="64" value="<?php print $offer->region_name ?>"/>
						</td>
					</tr>
				</table>
			</div>
				
			<!-- offer country -->
			<div id="tp_offer_section" class="tp-section">
				<?php
					if(empty($radios['country_type_code'])) {
						$radios['country_type_code'] = false;
						if(!empty($offer->country_code)) {
							$radios['country_type_code'] = true;
							$radios['country_type_name'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2" class="tp-radio-group">
							<input type="radio" id="country_type_code" name="country_type"<?php print tp_checked($radios['country_type_code']) ?>/>
							<label for="country_type_code">Standard Country</label>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="tp-select-group">
							<select name="country_code">
								<?php print tp_options($countries, $offer->country_code, 'Standard Country...') ?>
							</select>
						</td>
					</tr>
				</table>
				<?php
					if(empty($radios['country_type_name'])) {
						$radios['country_type_name'] = false;
						if(!empty($offer->country_name)) {
							$radios['country_type_name'] = true;
							$radios['country_type_code'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr class="tp-radio-group">
						<td colspan="2">
							<input type="radio" id="country_type_name" name="country_type"<?php print tp_checked($radios['country_type_name']) ?>/>
							<label for="country_type_name">Other Country</label>
						</td>
					</tr>
					<tr class="tp-inputtext-group">
						<td>
							<label for="country_name">Name</label>
						</td>
						<td>
							<input type="text" id="country_name" name="country_name" size="24" maxlength="64" value="<?php print $offer->country_name ?>"/>
						</td>
					</tr>
				</table>
			</div>
			
			<div class="tp-divider"></div>
			
			<!-- offer subdivision -->
			<div id="tp_subdivision_section" class="tp-section">
				<?php
					if(empty($radios['subdivision_type_code'])) {
						$radios['subdivision_type_code'] = false;
						if(!empty($offer->subdivision_code)) {
							$radios['subdivision_type_code'] = true;
							$radios['subdivision_type_name'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2" class="tp-radio-group">
							<input type="radio" id="subdivision_type_code" name="subdivision_type"<?php print tp_checked($radios['subdivision_type_code']) ?>/>
							<label for="subdivision_type_code">Standard State/Province</label>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="tp-select-group">
							<select name="subdivision_code">
								<?php print tp_options($subdivisions, $offer->subdivision_code, 'Standard State/Province...') ?>
							</select>
						</td>
					</tr>
				</table>
				<?php
					if(empty($radios['subdivision_type_name'])) {
						$radios['subdivision_type_name'] = false;
						if(!empty($offer->subdivision_name)) {
							$radios['subdivision_type_name'] = true;
							$radios['subdivision_type_code'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr class="tp-radio-group">
						<td colspan="2">
							<input type="radio" id="subdivision_type_name" name="country_type"<?php print tp_checked($radios['subdivision_type_name']) ?>/>
							<label for="subdivision_type_name">Other Subdivision</label>
						</td>
					</tr>
					<tr class="tp-inputtext-group">
						<td>
							<label for="subdivision_name">Name</label>
						</td>
						<td>
							<input type="text" id="subdivision_name" name="subdivision_name" size="24" maxlength="64" value="<?php print $offer->subdivision_name ?>"/>
						</td>
					</tr>
				</table>
			</div>
			
			<!-- offer city -->
			<div id="tp_city_section" class="tp-section">
				<?php
					if(empty($radios['city_type_code'])) {
						$radios['city_type_code'] = false;
						if(!empty($offer->city_code)) {
							$radios['city_type_code'] = true;
							$radios['city_type_name'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr class="tp-radio-group">
						<td colspan="2">
							<input type="radio" id="city_type_code" name="city_type"<?php print tp_checked($radios['city_type_code']) ?>/>
							<label for="city_type_code">Standard City</label>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<select name="city_code">
								<?php print tp_options($cities, $offer->city_code, 'Standard City...') ?>
							</select>
						</td>
					</tr>
				</table>
				<?php
					if(empty($radios['city_type_name'])) {
						$radios['city_type_name'] = false;
						if(!empty($offer->city_name)) {
							$radios['city_type_name'] = true;
							$radios['city_type_code'] = false;
						}
					}
				?>
				<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
					<tr class="tp-radio-group">
						<td colspan="2">
							<input type="radio" id="city_type_name" name="city_type"<?php print tp_checked($radios['city_type_name']) ?>/>
							<label for="city_type_name">Other City</label>
						</td>
					</tr>
					<tr class="tp-inputtext-group">
						<td>
							<label for="city_name">Name</label>
						</td>
						<td>
							<input type="text" id="city_name" name="city_name" size="24" maxlength="64" value="<?php print $offer->city_name ?>"/>
						</td>
					</tr>
				</table>
			</div>
		</div>
		
		<div class="tp-clear-both"></div>
	</fieldset>
	
	<fieldset id="tp_standard_pricing_fieldset">
		<h2>Standard Pricing</h2>
		<div id="tp_standard_pricing_section" class="tp-section">
			<?php
				if(empty($radios['standard_price_type_fixed'])) {
					$radios['standard_price_type_fixed'] = false;
					if(!empty($offer->standard_price_fixed_amount)) {
						$radios['standard_price_type_fixed'] = true;
						$radios['standard_price_type_range'] = false;
					}
				}
				if(empty($radios['standard_price_type_range'])) {
					$radios['standard_price_type_range'] = false;
					if(!empty($offer->standard_price_type_minimum_amount)) {
						$radios['standard_price_type_range'] = true;
						$radios['standard_price_type_fixed'] = false;
					}
				}
			?>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr>
					<td colspan="2" class="tp-radio-group">
						<input type="radio" id="standard_price_type_fixed" name="standard_price_type" value="fixed"<?php print tp_checked($radios['standard_price_type_fixed']) ?>/>
						<label for="standard_price_type_fixed">Fixed Price</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="standard_price_fixed_amount">Price</label>
					</td>
					<td>
						<input type="text" id="standard_price_fixed_amount" name="standard_price_fixed_amount" size="12" maxlength="12" value="<?php print $offer->standard_price_fixed_amount ?>"/>
					</td>
				</tr>
			</table>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2">
						<input type="radio" id="standard_price_type_range" name="standard_price_type" size="12" value="range"<?php print tp_checked($radios['standard_price_type_range']) ?>/>
						<label for="standard_price_type_range">Price Range</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="standard_price_type_minimum_amount">Minimum</label>
					</td>
					<td>
						<input type="text" id="standard_price_type_minimum_amount" name="standard_price_type_minimum_amount" size="12" maxlength="12" value="<?php print $offer->standard_price_type_minimum_amount ?>"/>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="standard_price_type_maximum_amount">Maximum</label>
					</td>
					<td>
						<input type="text" id="standard_price_type_maximum_amount" name="standard_price_type_maximum_amount" size="12" maxlength="12" value="<?php print $offer->standard_price_type_maximum_amount ?>"/>
					</td>
				</tr>
			</table>
			<div class="tp-clear-both"></div>
		</div>
	</fieldset>
	
	<fieldset id="tp_incentive_fieldset">
		<h2>Incentive</h2>
		
		<div class="tp-form-group tp-textarea-group">
			<label for="incentive_text">Incentive Description</label>
			<textarea id="incentive_text" name="incentive_text"><?php print $offer->incentive_text ?></textarea>
		</div>
		
		<div id="tp_incentive_discount_section" class="tp-section">
			<?php
				if(empty($radios['incentive_discount_price_type_fixed'])) {
					$radios['incentive_discount_price_type_fixed'] = false;
					if(!empty($offer->incentive_discount_price_fixed_amount)) {
						$radios['incentive_discount_price_type_fixed'] = true;
						$radios['incentive_discount_price_type_range'] = false;
						$radios['incentive_discount_price_type_percentage'] = false;
					}
				}
				if(empty($radios['incentive_discount_price_type_range'])) {
					$radios['incentive_discount_price_type_range'] = false;
					if(!empty($offer->incentive_discount_price_type_minimum_amount)) {
						$radios['incentive_discount_price_type_range'] = true;
						$radios['incentive_discount_price_type_fixed'] = false;
						$radios['incentive_discount_price_type_percentage'] = false;
					}
				}
				if(empty($radios['incentive_discount_price_type_percentage'])) {
					$radios['incentive_discount_price_type_percentage'] = false;
					if(!empty($offer->incentive_discount_percentage)) {
						$radios['incentive_discount_price_type_percentage'] = true;
						$radios['incentive_discount_price_type_fixed'] = false;
						$radios['incentive_discount_price_type_range'] = false;
					}
				}
			?>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr>
					<td colspan="2" class="tp-radio-group">
						<input type="radio" id="incentive_discount_price_type_fixed" name="incentive_discount_price_type" value="fixed"<?php print tp_checked($radios['incentive_discount_price_type_fixed']) ?>/>
						<label for="incentive_discount_price_type_fixed">Discount Fixed Amount</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="incentive_discount_price_fixed_amount">Amount</label>
					</td>
					<td>
						<input type="text" id="incentive_discount_price_fixed_amount" name="incentive_discount_price_fixed_amount" size="12" maxlength="12" value="<?php print $offer->incentive_discount_price_fixed_amount ?>"/>
					</td>
				</tr>
			</table>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2">
						<input type="radio" id="incentive_discount_price_type_range" name="incentive_discount_price_type" value="range"<?php print tp_checked($radios['incentive_discount_price_type_range']) ?>/>
						<label for="incentive_discount_price_type_range">Discount Amount Range</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="incentive_discount_price_type_minimum_amount">Minimum</label>
					</td>
					<td>
						<input type="text" id="incentive_discount_price_type_minimum_amount" name="incentive_discount_price_type_minimum_amount" size="12" maxlength="12" value="<?php print $offer->incentive_discount_price_type_minimum_amount ?>"/>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="incentive_discount_price_type_maximum_amount">Maximum</label>
					</td>
					<td>
						<input type="text" id="incentive_discount_price_type_maximum_amount" name="incentive_discount_price_type_maximum_amount" size="12" maxlength="12" value="<?php print $offer->incentive_discount_price_type_maximum_amount ?>"/>
					</td>
				</tr>
			</table>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2">
						<input type="radio" id="incentive_discount_price_type_percentage" name="incentive_discount_price_type" value="percentage"<?php print tp_checked($radios['incentive_discount_price_type_percentage']) ?>/>
						<label for="incentive_discount_price_type_percentage">Discount Percentage</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="incentive_discount_percentage">Amount</label>
					</td>
					<td>
						<input type="text" id="incentive_discount_percentage" name="incentive_discount_percentage" size="12" maxlength="12" value="<?php print $offer->incentive_discount_percentage ?>"/>
					</td>
				</tr>
			</table>
			<div class="tp-clear-both"></div>
		</div>
	</fieldset>
	
	<fieldset id="tp_adjusted_pricing_fieldset">
		<h2>Adjusted Pricing</h2>
		<div id="tp_adjusted_pricing_section" class="tp-section">
			<?php
				if(empty($radios['adjusted_price_type_fixed'])) {
					$radios['adjusted_price_type_fixed'] = false;
					if(!empty($offer->adjusted_price_fixed_amount)) {
						$radios['adjusted_price_type_fixed'] = true;
						$radios['adjusted_price_type_range'] = false;
					}
				}
				if(empty($radios['adjusted_price_type_range'])) {
					$radios['adjusted_price_type_range'] = false;
					if(!empty($offer->adjusted_price_type_minimum_amount)) {
						$radios['adjusted_price_type_range'] = true;
						$radios['adjusted_price_type_fixed'] = false;
					}
				}
			?>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2">
						<input type="radio" id="adjusted_price_type_fixed" name="adjusted_price_type" value="fixed"<?php print tp_checked($radios['adjusted_price_type_fixed']) ?>/>
						<label for="adjusted_price_type_fixed">Fixed Price</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="adjusted_price_fixed_amount">Price</label>
					</td>
					<td>
						<input type="text" id="adjusted_price_fixed_amount" name="adjusted_price_fixed_amount" size="12" maxlength="12" value="<?php print $offer->adjusted_price_fixed_amount ?>"/>
					</td>
				</tr>
			</table>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2">
						<input type="radio" id="adjusted_price_type_range" name="adjusted_price_type" value="range"<?php print tp_checked($radios['adjusted_price_type_range']) ?>/>
						<label for="adjusted_price_type_range">Price Range</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="adjusted_price_type_minimum_amount">Minimum</label>
					</td>
					<td>
						<input type="text" id="adjusted_price_type_minimum_amount" name="adjusted_price_type_minimum_amount" size="12" maxlength="12" value="<?php print $offer->adjusted_price_type_minimum_amount ?>"/>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="adjusted_price_type_maximum_amount">Maximum</label>
					</td>
					<td>
						<input type="text" id="adjusted_price_type_maximum_amount" name="adjusted_price_type_maximum_amount" size="12" maxlength="12" value="<?php print $offer->adjusted_price_type_maximum_amount ?>"/>
					</td>
				</tr>
			</table>
			<div class="tp-clear-both"></div>
		</div>
	</fieldset>
	
	<fieldset id="tp_availability_fieldset">
		<h2>Availability</h2>
		<div id="tp_availability_section" class="tp-section">
			<?php
				if(empty($radios['availability_datetime_type_fixed'])) {
					$radios['availability_datetime_type_fixed'] = false;
					if(!empty($offer->availability_fixed_datetime)) {
						$radios['availability_datetime_type_fixed'] = true;
						$radios['availability_datetime_type_range'] = false;
					}
				}
				if(empty($radios['availability_datetime_type_range'])) {
					$radios['availability_datetime_type_range'] = false;
					if(!empty($offer->availability_start_datetime)) {
						$radios['availability_datetime_type_range'] = true;
						$radios['availability_datetime_type_fixed'] = false;
					}
				}
			?>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr class="tp-radio-group">
					<td colspan="2">
						<input type="radio" id="availability_datetime_type_fixed" name="availability_datetime_type" value="fixed"<?php print tp_checked($radios['availability_datetime_type_fixed']) ?>/>
						<label for="availability_datetime_type_fixed">Fixed Availability Date</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="availability_fixed_datetime">Date/Time</label>
					</td>
					<td>
						<input type="text" id="availability_fixed_datetime" name="availability_fixed_datetime" size="19" maxlength="19" value="<?php print $offer->availability_fixed_datetime ?>"/>
					</td>
				</tr>
			</table>
			<table class="tp-form-group tp-choice-group" cellpadding="0" cellspacing="0">
				<tr>
					<td colspan="2" class="tp-radio-group">
						<input type="radio" id="availability_datetime_type_range" name="availability_datetime_type" value="range"<?php print tp_checked($radios['availability_datetime_type_range']) ?>/>
						<label for="availability_datetime_type_range">Availability Date/Time Range</label>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="availability_start_datetime">Start</label>
					</td>
					<td>
						<input type="text" id="availability_start_datetime" name="availability_start_datetime" size="19" maxlength="19" value="<?php print $offer->availability_start_datetime ?>"/>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="availability_end_datetime">End</label>
					</td>
					<td>
						<input type="text" id="availability_end_datetime" name="availability_end_datetime" size="19" maxlength="19" value="<?php print $offer->availability_end_datetime ?>"/>
					</td>
				</tr>
			</table>
			<div class="tp-clear-both"></div>
		</div>
	</fieldset>
	
	<fieldset id="tp_restrictions_fieldset">
		<h2>Restrictions</h2>
		
		<div class="tp-form-group tp-textarea-group">
			<label for="restriction_text">Restriction Text</label>
			<textarea id="restriction_text" name="restriction_text" rows="5" cols="10"></textarea>
		</div>
		
		<div id="tp_restriction_section" class="tp-section">
			<table class="tp-form-group" cellpadding="0" cellspan="0">
				<tr class="tp-select-group">
					<td>
						<label for="restriction_country_code">Residency Country</label>
					</td>
					<td>
						<select id="restriction_country_code" name="restriction_country_code">
							<?php print tp_options($countries, $offer->restriction_country_code, 'Country...') ?>
						</select>
					</td>
				</tr>
				<tr class="tp-select-group">
					<td>
						<label for="restriction_subdivision_code">Residency State/Province</label>
					</td>
					<td>
						<select id="restriction_subdivision_code" name="restriction_subdivision_code">
							<?php print tp_options($subdivisions, $offer->restriction_subdivision_code, 'State/Province...') ?>
						</select>
					</td>
				</tr>
				<tr class="tp-select-group">
					<td>
						<label for="restriction_membership_code">Membership/Affiliation</label>
					</td>
					<td>
						<select id="restriction_membership_code" name="restriction_membership_code">
							<?php print tp_options($affiliations, $offer->restriction_membership_code, 'Membership/Affiliation...') ?>
						</select>
					</td>
				</tr>
				<tr class="tp-select-group">
					<td>
						<label for="retriction_occupation_code">Occupation</label>
					</td>
					<td>
						<select id="restriction_occupation_code" name="restriction_occupation_code">
							<?php print tp_options($occupations, $offer->restriction_occupation_code, 'Occupation...') ?>
						</select>
					</td>
				</tr>
			</table>
			<table class="tp-form-group" cellpadding="0" cellspan="0">
				<tr class="tp-inputtext-group">
					<td>
						<label for="restriction_minimum_age">Minimum Age</label>
					</td>
					<td>
						<input type="text" id="restriction_minimum_age" name="restriction_minimum_age" size="4" maxlength="4" value="<?php print $offer->restriction_minimum_age ?>"/>
					</td>
				</tr>
				<tr class="tp-inputtext-group">
					<td>
						<label for="restriction_maximum_age">Maximum Age</label>
					</td>
					<td>
						<input type="text" id="restriction_maximum_age" name="restriction_maximum_age" size="4" maxlength="4" value="<?php print $offer->restriction_maximum_age ?>"/>
					</td>
				</tr>
			</table>
			<div class="tp-clear-both"></div>
		</div>
	</fieldset>
</div>